//
//  JobItemCell.m
//  laowu
//
//  Created by 尹桥印 on 15/5/4.
//  Copyright (c) 2015年 长沙市岳麓区立早网络科技有限公司. All rights reserved.
//

#import "JobItemCell.h"
@interface JobItemCell()
@property (weak, nonatomic) IBOutlet UIView *constansView;
@property (weak, nonatomic) IBOutlet UILabel *tileLabel;
@property (weak, nonatomic) IBOutlet UILabel *jobLabel;
@property (weak, nonatomic) IBOutlet UILabel *companyLabel;
@property (weak, nonatomic) IBOutlet UILabel *stateLabel;

@end
@implementation JobItemCell

-(instancetype)initWithTabelView:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
    static NSString *CellIdentiferId = @"JobItemCell";
    
    JobItemCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentiferId];
    if (!cell) {
        NSArray *nibs = [[NSBundle mainBundle] loadNibNamed:@"JobItemCell" owner:nil options:nil];
        cell = [nibs lastObject];
    }
    return cell;
}

-(void)setPeiXunItem:(PeiXunResult *)peiXunItem{
    _peiXunItem = peiXunItem;
    [self.tileLabel setText:peiXunItem.apply_date];
    [self.jobLabel setText:peiXunItem.job_name];
    [self.companyLabel setText:peiXunItem.company_name];
    [self.stateLabel setText:peiXunItem.state];
    
    [self.selectBtn setSelected:peiXunItem.selected];
}



- (IBAction)selectBtnClick:(id)sender {
    [self.selectBtn setSelected:!self.selectBtn.selected];
    [self.peiXunItem setSelected:self.selectBtn.selected];
    if (!self.selectBtn.selected) {
        [[NSNotificationCenter defaultCenter] postNotificationName:@"unselected" object:nil];
    }
}
@end
